// 导入变量和混合器
@import '@styles/variables.scss';
@import '@styles/mixins.scss';

// 弹窗遮罩层
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

// 弹窗容器
.settings-modal {
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

// 弹窗头部
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid $border-color;
    display: flex;
    align-items: center;
    justify-content: space-between;

    h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: $text-primary;
    }

    .close-button {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: transparent;
        color: $text-secondary;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.2s ease;

        &:hover {
            background: rgba($text-secondary, 0.1);
            color: $text-primary;
        }

        i {
            font-size: 16px;
        }
    }
}

// 弹窗内容
.modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;

    @include scrollbar;
}

// 设置项
.setting-section {
    margin-bottom: 24px;

    &:last-child {
        margin-bottom: 0;
    }

    label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 500;
        color: $text-primary;
    }

    input,
    select {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid $border-color;
        border-radius: 6px;
        font-size: 14px;
        color: $text-primary;
        background: $background-secondary;
        transition: all 0.2s ease;

        &:focus {
            border-color: $primary-color;
            outline: none;
        }

        &:disabled {
            background: $background-secondary;
            cursor: not-allowed;
        }
    }

    .info-text {
        padding: 8px 12px;
        font-size: 14px;
        color: $text-primary;
        background: $background-secondary;
        border-radius: 6px;
    }
}

// 头像上传
.avatar-upload {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .upload-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s ease;
        cursor: pointer;

        &:hover {
            opacity: 1;
        }

        input {
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        i {
            color: white;
            font-size: 24px;
        }
    }
}

// 弹窗底部
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid $border-color;
    display: flex;
    justify-content: flex-end;
    gap: 12px;

    button {
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;

        &.edit-button {
            background: $primary-color;
            color: white;
            border: none;

            &:hover {
                background: darken($primary-color, 10%);
            }
        }

        &.cancel-button {
            background: transparent;
            color: $text-secondary;
            border: 1px solid $border-color;

            &:hover {
                background: $background-secondary;
                color: $text-primary;
            }
        }

        &.save-button {
            background: $primary-color;
            color: white;
            border: none;

            &:hover {
                background: darken($primary-color, 10%);
            }
        }
    }
}